/*
 * @Author: Smthie Smthie@qq.com
 * @Date: 2024-05-16 11:01:21
 * @LastEditors: Smthie Smthie@qq.com
 * @LastEditTime: 2024-05-16 16:16:41
 * @FilePath: \ProtocolTool\src\renderer\src\api\devices.ts
 */
import request from '@/utils/request'

// 获取设备列表
export const getDevicePageAPI = (params) => request.get('/instr-info/page', { params })

// 获取设备详情
export const getDeviceDetailAPI = (id) => request.get('/instr-info/getById', { params: { id } })

// 编辑设备
export const updateDeviceAPI = (data) => request.put('/instr-info/updateById', data)

//下线
export const offLineDeviceAPI = (clientId) =>
  request.post(`/instr-info/instrOffline?clientId=${clientId}`)

//删除设备
export const deleteDeviceAPI = (id) => request.delete(`/instr-info/deleteById/${id}`)

//新增设备
export const addDeviceAPI = (data) => request.post('/instr-info/add', data)

//连接设备
export const instrOnlineAPI = (clientId) =>
  request.get('/instr-info/instrOnline', { params: { clientId } })

//一键下线Socket
export const downlineALLSocketAPI = () => request.post('/instr-info/allSocketOffline')
